<%--
  Created by IntelliJ IDEA.
  User: yanchao
  Date: 2021/11/6
  Time: 下午8:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>贷款列表 - 助学贷款管理系统</title>
    <link rel="stylesheet" href="./static/layui/css/layui.css">
    <link rel="stylesheet" href="./static/admin/css/style.css">
    <script src="./static/layui/layui.js"></script>
    <script src="./static/js/jquery-3.3.1.min.js"></script>
    <script src="./static/js/vue.min.js"></script>
    <script src="./static/admin/js/config.js"></script>
</head>
<body class="p20">
<div class="layui-row">
    <form class="form-inline" action="/listUser.do" method="post">
        <div class="layui-col-lg8">
            <div class="layui-input-inline" style="width: 300px">
                <input type="text" name="realname" value="" placeholder="手机/姓名" class="layui-input key">
            </div>
            <button type="submit" class="layui-btn sou">查询</button>
        </div>
    </form>
</div>

<table class="layui-table layui-form">

    <thead>
    <tr>
        <th><a>ID</a></th>
        <th>手机</th>
        <th>姓名</th>
        <th>性别</th>
        <th>年龄</th>
        <th>学校</th>
        <th>专业</th>
        <th>状态</th>
        <th><a>操作</a></th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${sessionScope.pages.beanList}" var="s" varStatus="status">
        <tr class="id36567">
            <td>${s.id}</td>
            <td>${s.phone}</td>
            <td>${s.realname}</td>
            <td>${s.sex}</td>
            <td>${s.age}</td>
            <td>${s.school}</td>
            <td>${s.major}</td>

            <td>
                <input type="checkbox" lay-filter="state" data-uid="36548" lay-text="正常|封禁" name="switch" checked="" lay-skin="switch">
            </td>
            <td>
                <a href="/findEditorUser.do?id=${s.id}">编辑</a>
                <a href="/findPwdUser.do?id=${s.id}">修改密码</a>
                <a onClick="rec(${s.id})">删除</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="page">
    <ul class="pagination">
        <!-- 这里来判断分页灰色显示 -->
        <c:if test="${sessionScope.pages.pageCode == 1}">
            <li class="disabled"><span><<</span></li>
        </c:if>
        <c:if test="${sessionScope.pages.pageCode != 1}">
            <li><a href="userList.do?pageCode=1"><<</a></li>
        </c:if>
        <c:forEach begin="1" end="${sessionScope.pages.totalPage}" varStatus="status">
            <li><a href="userList.do?pageCode=${status.index}">${status.index}</a></li>
        </c:forEach>
        <c:if test="${sessionScope.pages.pageCode == sessionScope.pages.totalPage}">
            <li class="disabled"><span>>></span></li>
        </c:if>
        <c:if test="${sessionScope.pages.pageCode != sessionScope.pages.totalPage}">
            <li><a href="userList.do?pageCode=${sessionScope.pages.totalPage}">>></a></li>
        </c:if>
    </ul>
</div>




<script src="./static/admin/js/script.js"></script>
<script type="text/javascript" language="javascript">
    function rec(id)
    {
        var mymessage=confirm("你确定要删除这条信息吗？");
        if(mymessage==true)
        {
            window.location.href="delUser.do?id="+id;
        }
        else if(mymessage==false)
        {
            window.location.href="userList.do";
        }
    }
</script>
</body>
</html>
